package com.yzpass.api.user.dto;

import com.yzpass.api.user.entity.RoleRes;
import lombok.Getter;
import lombok.Setter;

import java.util.UUID;

@Getter
@Setter
public class ResDTO {
    private String resId;

    private Boolean edit;

    private Boolean fullControl;

    public RoleRes toRoleRes(UUID roleId){
        RoleRes roleRes = new RoleRes();
        roleRes.setRoleId(roleId);
        roleRes.setResId(resId);
        roleRes.setEdit(edit);
        roleRes.setFullControl(fullControl);
        return roleRes;
    }

    public static ResDTO from(RoleRes roleRes){
        ResDTO dto = new ResDTO();
        dto.setResId(roleRes.getResId());
        dto.setEdit(roleRes.getEdit());
        dto.setFullControl(roleRes.getFullControl());
        return dto;
    }
}
